/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package tetrisdamage;

import org.lwjgl.glfw.GLFWKeyCallback;
import static org.lwjgl.glfw.GLFW.*;

/**
 *
 * @author Zheltoukhov
 */
public class KeyCallback extends GLFWKeyCallback {

    private Integer key = GLFW_KEY_UNKNOWN;

    @Override
    public void invoke(long window, int key, int scancode, int action, int mods) {
        if (action == GLFW_PRESS) {
            this.key = key;
            System.out.println(this.key);
        } else {
            this.key = GLFW_KEY_UNKNOWN;
            System.out.println(this.key);
        }
    }

    public Integer getKey() {
        return key;
    }
}
